﻿using ManYan.Application;
using ManYan.Domain.Model.Entity;
using Microsoft.AspNetCore.Mvc;

// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860

namespace ManYan.Api.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class TokenController : ControllerBase
    {
      private readonly   ITokenService _tokenService;
        public TokenController(ITokenService tokenService)
        {
            _tokenService = tokenService;
        }
        // GET: api/<TokenController>
        [HttpGet]
        public IEnumerable<tb_user_refresh_token> Get()
        {
            return _tokenService.List("select * from tb_user_refresh_token");
        }

        // GET api/<TokenController>/5
        [HttpGet("{id}")]
        public tb_user_refresh_token Get(Guid id)
        { 
            return _tokenService.Get(id);
        }

        // POST api/<TokenController>
        [HttpPost]
        public void Post([FromBody] string value)
        {
        }

        // PUT api/<TokenController>/5
        [HttpPut("{id}")]
        public void Put(int id, [FromBody] string value)
        {
        }

        // DELETE api/<TokenController>/5
        [HttpDelete("{id}")]
        public void Delete(int id)
        {
        }
    }
}
